package org.pupil.common;

import java.util.Objects;

/**
 * @Description: 服务提供方的资源定位符
 * @Author: pupil
 * @Date: 2024/07/10 下午 4:15
 */
public class URL {

    private String IP; // ip地址
    private Integer port; // 端口

    public URL(String IP, Integer port) {
        this.IP = IP;
        this.port = port;
    }


    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        URL url = (URL) o;
        return Objects.equals(IP, url.IP) && Objects.equals(port, url.port);
    }

    @Override
    public int hashCode() {
        return Objects.hash(IP, port);
    }
}
